﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using SisCRA.Config;

namespace SisCRA.Forms
{
    public partial class FormMain : Form
    {
        #region -Constructor-

        /// <summary>
        /// Construtor padrão.
        /// </summary>
        public FormMain()
        {
            InitializeComponent();
        }

        #endregion

        #region -Events-

        private void FormMain_Shown(object sender, EventArgs e)
        {
            if (InitialConfig.IsFirstRun())
            {
                using (FormInitial frmInitial = new FormInitial())
                {
                    frmInitial.ShowDialog(this);
                }
            }

            if (InitialConfig.IsFirstRun())
            {
                Application.Exit();
            }
        }

        private void studentToolStripMenuItem_Click(object sender, EventArgs e)
        {
            using (FormStudent frmStudent = new FormStudent())
            {
                frmStudent.ShowDialog(this);
            }
        }

        private void disciplineToolStripMenuItem_Click(object sender, EventArgs e)
        {
            using (FormDiscipline frmDiscipline = new FormDiscipline())
            {
                frmDiscipline.ShowDialog(this);
            }
        }

        private void activityToolStripMenuItem_Click(object sender, EventArgs e)
        {
            using (FormActivity frmActivity = new FormActivity())
            {
                frmActivity.ShowDialog(this);
            }
        }

        private void studentsEnrollmentToolStripMenuItem_Click(object sender, EventArgs e)
        {
            using (FormStudentEnrollment frmStudentEnrollment = new FormStudentEnrollment())
            {
                frmStudentEnrollment.ShowDialog(this);
            }
        }

        private void gradesAndFaultsToolStripMenuItem_Click(object sender, EventArgs e)
        {
            using (FormGradesAndFaults frmGradesAndFaults = new FormGradesAndFaults())
            {
                frmGradesAndFaults.ShowDialog(this);
            }
        }

        private void exitToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (DialogResult.Yes == MessageBox.Show(this, "Deseja realmente sair?", "Sair", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1))
            {
                Application.Exit();
            }
        }

        private void closingGradesToolStripMenuItem_Click(object sender, EventArgs e)
        {
            using (FormClosingGrades frmClosingGrades = new FormClosingGrades())
            {
                frmClosingGrades.ShowDialog(this);
            }
        }

        private void databaseToolStripMenuItem_Click(object sender, EventArgs e)
        {
            using (FormDatabase frmDatabase = new FormDatabase())
            {
                frmDatabase.ShowDialog(this);
            }
        }

        private void emailToolStripMenuItem_Click(object sender, EventArgs e)
        {
            using (FormEmail frmEmail = new FormEmail())
            {
                frmEmail.ShowDialog(this);
            }
        }

        private void aboutToolStripMenuItem_Click(object sender, EventArgs e)
        {
            using (FormAbout frmAbout = new FormAbout())
            {
                frmAbout.ShowDialog(this);
            }
        }

        #endregion
    }
}
